home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d18
/
turbotut.arc
/
INTMATH.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1989-06-30
|
844b
|
23 lines
PROGRAM integer_math_demo;
VAR a,b,c,d : INTEGER;
e : REAL;
BEGIN
a := 9; (* Simple assignment *)
b := a + 4; (* simple addition *)
c := a + b; (* simple addition *)
d := 4*a*b; (* multiplication *)
e := a/b; (* integer division with the result
expressed as a real number *)
d := b div a; (* integer division with the result
expressed as a truncated integer
number *)
d := b mod a; (* d is the remainder of the division,
in this case d = 4 *)
d := (a + b) div (b + 7); (* composite math statement *)
(* It will be up to you to print out some of these values *)
END.